proc pop {stack} {
	set index [expr "[llength $stack] - 1"]
	set result [lindex $stack $index]
	set stack [lrange $stack 0 end-1]
	return $result
}

proc push {stack element} {
	upvar $stack a
	lappend a $element
}

proc count {stack} {
	return [llength $stack]
}